﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.ZY
{
    class Class12
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {

            switch (ppa.Age)
            {
                case 18:
                    da.Value = ppa.Amount;
                    break;
                case 19:
                    da.Value = ppa.Amount * 1.1;
                    break;
                case 20:
                    da.Value = ppa.Amount * 1.2;
                    break;
                case 21:
                    da.Value = ppa.Amount * 1.3;
                    break;
                case 22:
                    da.Value = ppa.Amount * 0.5;
                    break;
            }



        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                if (ppa.Age >= 18)
                {
                    da.Value = ppa.Amount * 10;
                }
                else
                {
                    da.Value = ppa.TotalFee * 0.1;
                }

                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                if (ppa.Age < 18)
                {
                    da.Value = ppa.TotalFee;
                    da.Description = "如果现金价值较大则取现金价值";
                    ppa.IsCurrentFinish = true;
                }
            }
        }
    }
}
